﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DelStorageList.aspx.cs" Inherits="DelStorage_DelStorageList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>出库管理</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />

    <script src="../js/WdatePicker.js"></script>
     <style type="text/css">
        .find td{
            border-bottom: 1px solid #b5d6e6;
            border-right:1px solid #b5d6e6;
            border-left: 1px solid #b5d6e6;
        }
     </style>
    <script type="text/javascript">
        function fPopUpCalendarDlg(URL, Target, form)  //
        {
            now = new Date();
            var rom;
            var rom1
            rom = Math.ceil(Math.random() * 10000);
            rom1 = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + rom;
            showx = event.screenX - event.offsetX - 4; // + deltaX;
            showy = event.screenY - event.offsetY + 18; // + deltaY;
            //retval = window.showModalDialog(URL + "?radmom=" + rom1, "", "dialogWidth:700px; dialogHeight:400px; dialogLeft:" + showx + "px; dialogTop:" + showy + "px; status:no; directories:yes;help:no;scrollbars:no;Resizable=no; ");
            var retval = window.open(URL, "win2", "height=400px, width=700px, top=" + showy + ", left=" + showx + ",modal=yes,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");

            if (retval != null) {
                var Material = retval.split(",");
                //document.forms(0).txtW01.value = Material[0];           //凭证号
                document.forms(0).txtStorageNo.value = Material[1];           //单据号
                //document.forms(0).txtCDT.value = Material[2];           //单据时间
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td style="height: 30px">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="background-image: url(../images/tab_03.gif); background-repeat: repeat-x; width: 12px;">&nbsp;
                                </td>
                                <td style="background-image: url(../images/tab_05.gif); background-repeat: repeat-x; height: 30px;">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td style="width: 46%; vertical-align: middle;">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td style="width: 5%; vertical-align: middle;">
                                                            <img src="../images/tb.gif" width="16" height="16" />
                                                        </td>
                                                        <td style="width: 95%;">
                                                            <span>你当前的位置</span>：业务管理-出库管理
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td width="54%"></td>
                                        </tr>
                                    </table>
                                </td>
                                <td width="16" style="background-image: url(../images/tab_07.gif); height: 30px;">&nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="background-image: url(../images/tab_12.gif); width: 8px;">&nbsp;
                                </td>
                                <td>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                        <tr>
                                            <td style="padding: 2px;">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="find">
                                                    <tr>
                                                        <td>
                                                            <table width="100%" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;border-collapse:collapse;">
                                                                <tr style="height: 22px;">
                                                                    <td style="width: 80px;" align="right">出库单号：
                                                                    </td>
                                                                    <td style="width: 200px; padding-left: 2px; padding-right: 2px;">
                                                                        <asp:TextBox ID="txtStorageNo" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"></asp:TextBox>

                                                                        <input onclick="fPopUpCalendarDlg('DelDataListPOP.aspx', 'Item', form1); return false;"
                                                                            src="../images/fc.gif" style="border-right: 0px; border-top: 0px; border-left: 0px; width: 14px; border-bottom: 0px; height: 11px"
                                                                            type="image" />
                                                                    </td>
                                                                    <td style="width: 80px;" align="right">物料编号：
                                                                    </td>
                                                                    <td style="width: 200px; padding-left: 2px;">
                                                                        <asp:TextBox ID="txtMat_Code" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"
                                                                            MaxLength="30"></asp:TextBox>
                                                                    </td>
                                                                         <td style="width: 80px;" align="right">物料名称：
                                                                    </td>
                                                                    <td style="width: 200px; padding-left: 2px;">
                                                                        <asp:TextBox ID="txtMat_Name" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"
                                                                            MaxLength="30"></asp:TextBox>
                                                                    </td>
                                                                    <td style="padding-left: 4px; padding-right: 4px;" align="left">
                                                                        <font color="#ff0000"><b>
                                                                            <asp:Label ID="labMsg" runat="server"></asp:Label></b></font>
                                                                    </td>
                                                                </tr>
                                                                <tr>

                                                                    <td style="width: 80px;" align="right">起始日期：
                                                                    </td>
                                                                    <td style="width: 200px; padding-left: 2px;">
                                                                        <asp:TextBox ID="txtDateS" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"
                                                                            onfocus="new WdatePicker(this)"></asp:TextBox>
                                                                    </td>
                                                                    <td style="width: 80px;" align="right">截止日期：
                                                                    </td>
                                                                    <td style="width: 200px; padding-left: 2px;">
                                                                        <asp:TextBox ID="txtDateE" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"
                                                                            onfocus="new WdatePicker(this)"></asp:TextBox>
                                                                    </td>
                                                                          <td  style="width: 80px;" align="right">生产通知单：</td>
                                                                        <td  style="width: 200px; padding-left: 2px;">
                                                                            <asp:TextBox ID="txt_TS01" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"
                                                                            MaxLength="30"></asp:TextBox></td>
                                                                    <td  style="padding-left: 4px;padding-top:2px; padding-right: 4px;" align="left">
                                                                        <asp:ImageButton ID="ibtnSearch" runat="server" ImageUrl="~/Images/btn/btn_Search.gif"
                                                                            OnClick="ibtnSearch_Click" />&nbsp;
                                                                     <asp:ImageButton ID="btn_Reset1" runat="server" ImageUrl="~/Images/btn/btn_Reset.gif"
                                                                         OnClick="btn_Reset1_Click" />&nbsp;
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <tr>
                                                    <td style="padding: 2px;">
                                                        <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 420px; overflow-x: auto; overflow-y: auto;">
                                                            <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" Width="100%" BorderWidth="1px"
                                                                BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="PID" AllowPaging="True" OnPageIndexChanging="gv_PageIndexChanging" OnRowDataBound="gv_RowDataBound"
                                                                OnRowCancelingEdit="gv_RowCancelingEdit" OnRowEditing="gv_RowEditing" PageSize="16" >
                                                                <Columns>
                                                                    <asp:TemplateField HeaderText="序号">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                                            <%--<asp:Label ID="lab_PID" runat="server" Text='<%# Bind("PID") %>' Visible="false"></asp:Label>--%>
                                                                            <asp:Label ID="lab_DETAIL_PID" runat="server" Text='<%# Bind("DETAIL_PID") %>' Visible="false"></asp:Label>
                                                                            <asp:Label ID="lab_BillMatCount" runat="server" Text='<%# Bind("Num") %>' Visible="False"></asp:Label>
                                                                            <asp:Label ID="lab_TS01" runat="server" Text='<%# Bind("TS01") %>' Visible="False"></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="20" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="出库单号">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labStockNo" runat="server" Text='<%# Bind("StockNo") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="100" />
                                                                    </asp:TemplateField>

                                                                    <asp:TemplateField HeaderText="物料名称">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="lbtn_Mat_Name" runat="server" Text='<%# Bind("Mat_Name") %>'
                                                                                ForeColor="Blue" CommandArgument='<%# Bind("Mat_Code") %>'></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="130" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="物料编号">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labMat_Code" runat="server" Text='<%# Bind("Mat_Code") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="80" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="出库数量">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labNum" runat="server" Text='<%# Bind("Num") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="60" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="已出数量">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labAct_Num" runat="server" Text='<%# Bind("Act_Num") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="60" />
                                                                    </asp:TemplateField>

                                                                    <asp:TemplateField HeaderText="生产通知单">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labTS01" runat="server" Text='<%# Bind("TS01") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="100" />
                                                                    </asp:TemplateField>
                                                                     <asp:TemplateField HeaderText="规格">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labS01" runat="server" Text='<%# Bind("S01") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="60" />
                                                                    </asp:TemplateField>
                                                                      <asp:TemplateField HeaderText="材质">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labTM01" runat="server" Text='<%# Bind("TM01") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="60" />
                                                                    </asp:TemplateField>
                                                                     <asp:TemplateField HeaderText="长度">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labTM03" runat="server" Text='<%# Bind("TM03") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="40" />
                                                                    </asp:TemplateField>
                                                                      <asp:TemplateField HeaderText="备注">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labS02" runat="server" Text='<%# Bind("S02") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="140" />
                                                                    </asp:TemplateField>
                                                                       <asp:TemplateField HeaderText="单位">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labUnit" runat="server" Text='<%# Bind("Unit_Base") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="40" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="创建时间">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="labCDT" runat="server" Text='<%# Bind("CDT") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="110" />
                                                                    </asp:TemplateField>

                                                                    <asp:TemplateField HeaderText="自动出库">
                                                                        <ItemTemplate>
                                                                            <asp:ImageButton ID="ibtnAutoOut" runat="server" CommandArgument='<%# Bind("PID") %>'
                                                                                ImageUrl="../Images/btn/btn_Ok.gif" Style="height: 16px" OnClick="ibtnAutoOut_Click" />

                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="6%" />
                                                                    </asp:TemplateField>

                                                                    <%--<asp:CommandField HeaderText="编辑" ShowEditButton="True" ButtonType="Image" CancelImageUrl="~/Images/del.gif"
                                                                    EditImageUrl="~/Images/edt.gif" UpdateImageUrl="~/Images/edt.gif">
                                                                    <ItemStyle Width="5%" />
                                                                </asp:CommandField>--%>
                                                                    <%--<asp:TemplateField HeaderText="选择">
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="ibtnIMG_Search" runat="server" CommandArgument='<%# Bind("Mat_Code") %>'
                                                                    ImageUrl="~/Images/33.gif" Style="height: 14px"  OnClick="ibtnIMG_Search_Click" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="5%" />
                                                        </asp:TemplateField>--%>
                                                                </Columns>
                                                                <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                                <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                            </asp:GridView>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td height="25" style="padding: 2px;">
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                                            <tr>
                                                                <td style="padding-left: 4px; width: 50px; height: 25px;"></td>
                                                                <td style="padding-right: 4px; padding-top: 2px;" align="right">
                                                                    <font color="#ff0000"><b>
                                                                        <asp:Label ID="Label1" runat="server"></asp:Label></b></font>&nbsp;

                                                                <asp:ImageButton ID="ibt_reset" runat="server" ImageUrl="~/Images/btn/btn_Reset.gif"
                                                                    OnClick="ibt_reset_Click" />&nbsp;

                                                                <asp:ImageButton ID="ibtn_jianxian" runat="server" ImageUrl="~/Images/btn/btn_jianxuan.gif"
                                                                    OnClick="ibtn_jianxian_Click" Visible="false" ToolTip="在线拣选" />&nbsp;
                                                                 <asp:ImageButton ID="ibtn_InOut" runat="server" ImageUrl="~/Images/btn/btn_InOut.gif"
                                                                     OnClick="ibtn_InOut_Click" ToolTip="拣选整出" />&nbsp;
                                                              
                                                                 <asp:ImageButton ID="ibtnAllOUT" runat="server" ImageUrl="~/Images/btn/btnLiXianZhengChu.gif"
                                                                     ToolTip="离线整出" Visible="false" OnClick="ibtnAllOUT_Click" />

                                                                </td>

                                                                <td align="left" style="width: 250px; height: 25px;">
                                                                    <asp:Label ID="Label2" runat="server" Text="选择出口号："></asp:Label>

                                                                    <asp:DropDownList ID="ddlSQIDE" runat="server">
                                                                        <asp:ListItem Selected="True" Value="0">自动获取出口</asp:ListItem>
                                                                        <%-- <asp:ListItem Value="1013">1#输送机口（1013）</asp:ListItem>
                                                                          <asp:ListItem Value="1084">2#输送机口（1084）</asp:ListItem>--%>
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                        <asp:GridView ID="gvDate" runat="server" AutoGenerateColumns="False" Width="100%" 
                                                            BorderWidth="1px" BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="PID" AllowPaging="false"
                                                            OnRowDataBound="gvDate_RowDataBound">
                                                            <Columns>
                                                                <asp:TemplateField HeaderText="序号">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="20" />
                                                                </asp:TemplateField>
                                                                <asp:BoundField DataField="Mat_Name" HeaderText="物料名称">
                                                                    <ItemStyle Width="250" />
                                                                </asp:BoundField>
                                                                <%--<asp:TemplateField HeaderText="出库数量">
                                                                    <ItemTemplate>
                                                                        <asp:TextBox ID="txtNum" runat="server" Width="40" Text="0"></asp:TextBox>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="30" />
                                                                </asp:TemplateField>--%>
                                                                <asp:TemplateField HeaderText="出库数量">
                                                                    <ItemTemplate>
                                                                        <asp:TextBox ID="txtNum" runat="server" Width="40px" Text='<%# Bind("Num") %>'></asp:TextBox>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="30" />
                                                                </asp:TemplateField>
                                                                <asp:BoundField DataField="Mat_Num" HeaderText="库存数量">
                                                                    <ItemStyle Width="40" />
                                                                </asp:BoundField>
                                                                <%--<asp:BoundField DataField="S01" HeaderText="库存标示">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>--%>
                                                                <%--<asp:BoundField DataField="S02" HeaderText="库存编号">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>--%>
                                                                <%--<asp:BoundField DataField="S04" HeaderText="物资用途">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>--%>
                                                                <%-- <asp:BoundField DataField="S06" HeaderText="公司">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>--%>
                                                                <%-- <asp:BoundField DataField="S10" HeaderText="是否固定资产">
                                                                    <ItemStyle Width="80" />
                                                                </asp:BoundField>--%>
                                                                <asp:BoundField DataField="delPID" HeaderText="出库单明细PID">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>
                                                                <asp:BoundField DataField="StockNo" HeaderText="出库单号">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>
                                                                <asp:BoundField DataField="Tray_id" HeaderText="托盘号">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>
                                                                <asp:BoundField DataField="Pos_ID" HeaderText="货位号">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>
                                                                <%--<asp:BoundField DataField="Lane_ID" HeaderText="道口号">
                                                                    <ItemStyle Width="70" />
                                                                </asp:BoundField>--%>
                                                                <asp:TemplateField HeaderText="PID" Visible="false">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="lbl_PID" runat="server" Text='<%# Bind("PID") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="10%" />
                                                                </asp:TemplateField>
                                                                <%-- <asp:TemplateField HeaderText="评估类型">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="lblTS02" runat="server" Text='<%# Bind("TS02") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="10%" />
                                                                </asp:TemplateField>--%>
                                                                <%-- <asp:TemplateField HeaderText="批号">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="lblS03" runat="server" Text='<%# Bind("S03") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="10%" />
                                                                </asp:TemplateField>--%>
                                                                <asp:TemplateField HeaderText="编辑">
                                                                    <ItemTemplate>
                                                                        <asp:ImageButton ID="ibtndelete" runat="server" CommandArgument='<%# Container.DataItemIndex%>'
                                                                            ImageUrl="~/Images/del.gif" Style="height: 16px" OnClick="ibtndelete_Click" />
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="10%" />
                                                                </asp:TemplateField>
                                                            </Columns>
                                                            <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                            <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                        </asp:GridView>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="padding: 2px;">
                                                        <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 300px; overflow-x: auto; overflow-y: auto;">
                                                        </div>
                                                    </td>
                                                </tr>
                                    </table>
                                </td>
                                <td style="background-image: url(../images/tab_15.gif); width: 8px;">&nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="background-image: url(../images/tab_19.gif); height: 35px;">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="width: 12px; height: 35px;">
                                    <img src="../images/tab_18.gif" width="12" height="35" />
                                </td>
                                <td>&nbsp;
                                </td>
                                <td width="16">
                                    <img src="../images/tab_20.gif" width="16" height="35" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <asp:HiddenField ID="hidden" runat="server" />
        </div>
    </form>
</body>
</html>
